from django.db import models
from fuguangeduapi.utils.models import BassModel
# Create your views here.
class NavModel(BassModel):
    POSTION_CHOICES={
        (0,'顶部导航'),
        (1,'底部导航')
    }
    link = models.CharField(max_length=255,verbose_name='导航链接')
    is_http= models.BooleanField(default=False,verbose_name='是否是外部链接')
    # 区分顶部导航或者底部导航
    position = models.IntegerField(choices=POSTION_CHOICES,default=0,null=True,verbose_name='导航区分')
    def __str__(self):
        return self.name
    class Meta:
        db_table = 'fg_nav'
        verbose_name_plural = '导航菜单'


class BannerModel(BassModel):
    image = models.ImageField(upload_to="banner/%Y/",verbose_name="图片地址")
    link = models.CharField(max_length=300,verbose_name='链接')
    note = models.CharField(max_length=100,verbose_name='备注信息')
    is_http = models.BooleanField(default=False,verbose_name='是否是外部链接',help_text="站点外部链接：http://www.baidu.com <br>站点内的链接：/home/detail/")
    class Meta:
        db_table = 'fg_banner'
        verbose_name_plural = '轮播广告'

